using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using Liya.Crm.Data.Models.Mapping;

namespace Liya.Crm.Data.Models
{
    public class Ly_CrmContext : DbContext
    {
        static Ly_CrmContext()
        {
            Database.SetInitializer<Ly_CrmContext>(null);
        }

		public Ly_CrmContext()
			: base("Name=Ly_CrmContext")
		{
		}

        public DbSet<Sys_Company> Sys_Company { get; set; }
        public DbSet<Sys_Department> Sys_Department { get; set; }
        public DbSet<Sys_Function> Sys_Function { get; set; }
        public DbSet<Sys_Module> Sys_Module { get; set; }
        public DbSet<Sys_Permission> Sys_Permission { get; set; }
        public DbSet<Sys_Role> Sys_Role { get; set; }
        public DbSet<Sys_RoleUser> Sys_RoleUser { get; set; }
        public DbSet<Sys_UserInfo> Sys_UserInfo { get; set; }
        public DbSet<sysdiagram> sysdiagrams { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new Sys_CompanyMap());
            modelBuilder.Configurations.Add(new Sys_DepartmentMap());
            modelBuilder.Configurations.Add(new Sys_FunctionMap());
            modelBuilder.Configurations.Add(new Sys_ModuleMap());
            modelBuilder.Configurations.Add(new Sys_PermissionMap());
            modelBuilder.Configurations.Add(new Sys_RoleMap());
            modelBuilder.Configurations.Add(new Sys_RoleUserMap());
            modelBuilder.Configurations.Add(new Sys_UserInfoMap());
            modelBuilder.Configurations.Add(new sysdiagramMap());
        }
    }
}
